package org.grottarossa.template.data.pojo.workflows;

import org.grottarossa.template.data.enums.EnumWorkItemType;
import org.grottarossa.template.drivers.components.tokens.GenericId;


public class WorkItem
{
	protected int workflowId;
	protected int workflowVersion;
	protected String lockedByUser;
	protected String activityName;
	protected GenericId objectId; // casefolder, filestore, formdata, process
	protected int templateId;
	protected EnumWorkItemType workItemType;

	public boolean isLocked()
	{
		return (this.lockedByUser!=null);
	}

	public WorkItem() {}

	public int getWorkflowId() {
		return workflowId;
	}
	public int getWorkflowVersion() {
		return workflowVersion;
	}
	public void setWorkflowVersion(int workflowVersion) {
		this.workflowVersion = workflowVersion;
	}
	public void setWorkflowId(int workflowId) {
		this.workflowId = workflowId;
	}

	public void setLockedByUser(String user) {
		this.lockedByUser = user;
	}
	public boolean isLockedBy(String user) {
		return (user.equals(lockedByUser));
	}

	public void setActivityName(String activity) {
		this.activityName = activity;
	}
	public String getActivityName() {
		return this.activityName;
	}

	public void setWorkItemType(EnumWorkItemType workItemType) {
		this.workItemType = workItemType;
	}

	public EnumWorkItemType getWorkItemType() {
		return workItemType;
	}

	public void setObjectId(GenericId objectId) {
		this.objectId = objectId;
	}

	public GenericId getObjectId() {
		return objectId;
	}

	public void setTemplateId(int templateId) {
		this.templateId = templateId;
	}

	public int getTemplateId() {
		return templateId;
	}
}
